import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import model.session.SessionBlock;

import org.junit.Test;

/**
 * 
 */

/**
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public class TestSessionBlock {

	@Test
	public void testGetFirst() {
		SessionBlock block = new SessionBlock();

		assertSame("session block with itself as first doesn't work", block, block.getFirst());

		SessionBlock block2 = new SessionBlock(block);

		assertSame("session block constructor doesn't work", block, block2.getFirst());
	}

	@Test
	public void testWrongConstructor() {
		try
		{
			new SessionBlock(null);
		} catch (IllegalArgumentException e)
		{
			return;
		}

		fail("was able to initialize a session block with null as first");
	}
}
